<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <title>城市选择</title>
    
  </head>
  <body>
  <script type="text/javascript" src="../js/get_url_parameter.js" ></script>
	<!--引入高德地图JSAPI -->
	<script src="//webapi.amap.com/maps?v=1.3&key=0d1d97cc66316b3fc35b0fca893f0d5b"></script>
	<!--引入UI组件库（1.0版本） -->
	<script src="//webapi.amap.com/ui/1.0/main.js"></script>
	<style>
		html,body{
			background: #efefef;
		}
    	.amap-ui-mobi-city-picker .topbar{
    		height: 55px;
    	}
    	.amap-ui-mobi-city-picker .search-box{
    		margin-top: 0;
    	}
    	.amap-ui-mobi-city-picker .city_fixed_title{
    		top: 55px;
    	}
    	.topbar .title{
    		display: none;
    	}
    	.topbar .closebtn{
    		display: none;
    	}
  </style>
	<script>
		var phone=request("phone")
		var device=request("from")
		var from_type=request("type")
		//设置DomLibrary
	  //AMapUI.setDomLibrary(Zepto);
		
		//加载MobiCityPicker，loadUI的路径参数为模块名中 'ui/' 之后的部分
		AMapUI.loadUI(['misc/MobiCityPicker'], function(MobiCityPicker) {
		
		  var cityPicker = new MobiCityPicker({
		    //topGroups: ..., // 顶部城市列表
//		     topGroups:[
//		     {
//			      id: 'g1',//分组ID，需唯一
//			      title: '热门城市',//分组标题
//			      anchorTitle: '热',//右侧锚点标题，通常单个字符
//			      adcodes: [ //城市的adcode列表，adcodes信息可以调用MobiCityPicker.getCityData()获取
//			          "110000",
//			      ]
//			   },
//		     {
//			      id: 'g1',//分组ID，需唯一
//			      title: '热门城市',//分组标题
//			      anchorTitle: '热',//右侧锚点标题，通常单个字符
//			      adcodes: [ //城市的adcode列表，adcodes信息可以调用MobiCityPicker.getCityData()获取
//			          "110000",
//			      ]
//			   }
//		    ]
		  });
		
		  //监听城市选中事件
		  cityPicker.on('citySelected', function(cityInfo) {
		    //隐藏城市列表
		   // cityPicker.hide();
				//alert(cityInfo.name)
				location.replace("school_list.html?city="+cityInfo.name+"&phone="+phone+"&from="+device+"&type="+from_type)
		    //选中的城市信息
		    console.log(cityInfo);
		  });
		  
		  //显示城市列表，可以用某个click事件触发
		  cityPicker.show();
	});
	</script>
  </body>
</html>